-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Google Ads - update to API v21 #18224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughGoogle Ads integration updated from v18 to v21: internal endpoint paths, documentation links, example README, and action/source metadata were revised; package and action/source versions were bumped. No runtime logic, control flow, or public API signatures were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Assessment against linked issues
Poem
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs (1)
34-36: Normalize email before hashing for Customer Match compliance.Google requires trimming + lowercasing prior to SHA-256; current code hashes raw input, reducing match rate and risking policy noncompliance.
Apply:
async run({ $ }) { const { googleAds, accountId, customerClientId, contactEmail, userListId, } = this; + const normalizedEmail = String(contactEmail).trim().toLowerCase(); @@ userIdentifiers: [ { - hashedEmail: crypto.createHash("sha256").update(contactEmail) - .digest("hex"), + hashedEmail: crypto.createHash("sha256") + .update(normalizedEmail, "utf8") + .digest("hex"), }, ],Also applies to: 60-63
components/google_ads/README.md (4)
24-24: Fix typo: “interal” → “internal”.-The Pipedream components interact with Google Ads API through an interal proxy service, which protects Pipedream's developer token. +The Pipedream components interact with Google Ads API through an internal proxy service, which protects Pipedream's developer token.
49-59: Update example to v21 for consistency.Example still points to v16; this PR upgrades to v21.
const googleAdsReq = { method: "post", - url: "/v16/customers/1234567890/googleAds:search", + url: "/v21/customers/1234567890/googleAds:search", headers: { Authorization: `Bearer ${this.googleAds.$auth.oauth_access_token}`, }, data: { query: "SELECT campaign.id, campaign.name FROM campaign", }, };
86-107: Align Connect SDK example with v21.url: "/v19/customers:listAccessibleCustomers", + // v21 upgrade + // url: "/v21/customers:listAccessibleCustomers",If you prefer a direct change:
- url: "/v19/customers:listAccessibleCustomers", + url: "/v21/customers:listAccessibleCustomers",
113-122: Align Connect REST example with v21.-d '{ - "url": "/v19/customers:listAccessibleCustomers", + "url": "/v21/customers:listAccessibleCustomers", "method": "GET", # "data": {} # If you need to send a body with a POST request, define it here }'components/google_ads/package.json (1)
15-18: Remove redundant “crypto” dependency (prefer Node core).Node’s built-in crypto shadows the npm “crypto” package; keeping the npm dep is unnecessary and a supply-chain risk.
"dependencies": { - "@pipedream/platform": "^3.0.3", - "crypto": "^1.0.1" + "@pipedream/platform": "^3.0.3" }
🧹 Nitpick comments (3)
components/google_ads/actions/create-customer-list/common-constants.mjs (1)
201-209: Centralize the v21 docs base to ease future upgrades.Reduce maintenance by defining a shared base like
const GA_RPC_V21 = "https://developers.google.com/google-ads/api/reference/rpc/v21/";and composing links.Also applies to: 215-233
components/google_ads/sources/new-lead-form-entry/new-lead-form-entry.mjs (2)
10-10: Tighten the description and keep the helpful link.Minor phrasing nit; also keep the same URL.
- description: "Emit new event for new leads on a Lead Form. [See the documentation](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest)", + description: "Emit an event when a new lead is submitted via a Lead Form. [See the v21 Search (REST) docs](https://developers.google.com/google-ads/api/reference/rpc/v21/GoogleAdsService/Search?transport=rest).",
32-32: Doc links updated correctly; consider de-duping the version string to reduce future churn.Optional: define a single docs version token and interpolate into both links here (and the description) to simplify the next upgrade.
Example (outside this hunk, near the top of file):
const DOCS_VER = "v21";Then update strings to:
content: `If needed, see Google's documentation on [submission fields](https://developers.google.com/google-ads/api/reference/rpc/${DOCS_VER}/LeadFormSubmissionField) and [custom submission fields](https://developers.google.com/google-ads/api/reference/rpc/${DOCS_VER}/CustomLeadFormSubmissionField).`,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
components/google_ads/README.md(1 hunks)components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs(1 hunks)components/google_ads/actions/common/props.mjs(1 hunks)components/google_ads/actions/create-customer-list/common-constants.mjs(5 hunks)components/google_ads/actions/create-customer-list/create-customer-list.mjs(2 hunks)components/google_ads/actions/create-report/create-report.mjs(4 hunks)components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs(2 hunks)components/google_ads/google_ads.app.mjs(9 hunks)components/google_ads/package.json(1 hunks)components/google_ads/sources/new-campaign-created/new-campaign-created.mjs(2 hunks)components/google_ads/sources/new-lead-form-entry/new-lead-form-entry.mjs(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs (1)
components/google_ads/actions/common/props.mjs (2)
getAdditionalFields(4-9)getAdditionalFields(4-9)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Lint Code Base
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (11)
components/google_ads/actions/common/props.mjs (1)
2-2: Docs link updated to v21 — LGTM.components/google_ads/package.json (1)
3-3: Package version bump is fine.components/google_ads/sources/new-campaign-created/new-campaign-created.mjs (1)
9-10: v21 doc links and version bump look good.No logic changes; references resolve to v21.
Also applies to: 22-22
components/google_ads/actions/create-report/create-report.mjs (2)
21-22: Doc links updated to v21 — looks good.References now point to RPC v21 for Search, Fields, Segments, and Metrics.
Also applies to: 46-46, 109-110, 120-121
46-46: All resourceOption.value slugs resolve to valid v21 Fields docs (HTTP 200).components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs (1)
23-27: Doc links and version bump align with v21.Both the type link and additionalFields docs now target RPC v21.
components/google_ads/actions/create-customer-list/common-constants.mjs (1)
60-61: Docs migrated to RPC v21 — approved.All updated references (CrmBasedUserListInfo, FlexibleRuleUserListInfo, UserListLogicalRuleInfo, ConversionAction, RemarketingAction, and type option docs) now point to v21.
Also applies to: 77-78, 87-88, 95-96, 118-119, 201-209, 215-233
components/google_ads/google_ads.app.mjs (1)
37-37: Prop doc references updated to v21.Account, customer client, and lead form references look correct.
Also applies to: 49-50, 74-75
components/google_ads/actions/create-customer-list/create-customer-list.mjs (2)
17-18: Top-level docs + version updated to v21 — approved.
36-36: List type docs now point to RPC v21 — approved.components/google_ads/sources/new-lead-form-entry/new-lead-form-entry.mjs (1)
11-11: Google Ads docs/wiring updated to v21
No pre-v21 RPC links found and google_ads.app.mjs exclusively references v21.
components/google_ads/actions/add-contact-to-list-by-email/add-contact-to-list-by-email.mjs
Show resolved
Hide resolved
components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/google_ads/google_ads.app.mjs (1)
120-131: Update hardcoded API version and verify GAQL v21 field compatibility
- README.md still references
/v19/customers:listAccessibleCustomerson lines 100 and 118; change both to/v21/customers:listAccessibleCustomers.- GAQL queries in
components/google_adsshow no obvious deprecated fields (e.g.,shared_set,user_list_size_range), but manually confirm that allSELECT/FROM/WHEREclauses in yourQUERIES.*functions use valid v21 resource and field names.
♻️ Duplicate comments (2)
components/google_ads/google_ads.app.mjs (2)
229-229: Normalize HTTP method casing to match the rest of this file.You mix
"post"and"POST". Standardize to one form (recommend"post"to match other calls and prior review guidance).- method: "POST", + method: "post", @@ - method: "POST", + method: "post", @@ - method: "POST", + method: "post",Also applies to: 236-236, 245-245
124-124: De-duplicate the API version string with a constant.Avoid scattering
"v21"literals; it simplifies the next upgrade and reduces copy/patch errors.@@ import { QUERIES } from "./common/queries.mjs"; +const API_VERSION = "v21"; + @@ - path: "/v21/customers/{customerClientId}/googleAds:search", + path: `/${API_VERSION}/customers/{customerClientId}/googleAds:search`, @@ - path: "/v21/customers:listAccessibleCustomers", + path: `/${API_VERSION}/customers:listAccessibleCustomers`, @@ - path: "/v21/customers/{customerClientId}/userLists:mutate", + path: `/${API_VERSION}/customers/{customerClientId}/userLists:mutate`, @@ - path: "/v21/customers/{customerClientId}/conversionActions:mutate", + path: `/${API_VERSION}/customers/{customerClientId}/conversionActions:mutate`, @@ - path: `/v21/${path}:addOperations`, + path: `/${API_VERSION}/${path}:addOperations`, @@ - path: "/v21/customers/{customerClientId}/offlineUserDataJobs:create", + path: `/${API_VERSION}/customers/{customerClientId}/offlineUserDataJobs:create`, @@ - path: `/v21/${path}:run`, + path: `/${API_VERSION}/${path}:run`,Also applies to: 135-135, 154-154, 219-219, 231-231, 238-238, 247-247
🧹 Nitpick comments (2)
components/google_ads/google_ads.app.mjs (2)
135-136: Be explicit about the proxied HTTP method.
listAccessibleCustomersomitsmethod. If the proxy defaults ever change, this could break. Setmethod: "get"explicitly.- const response = await this._makeRequest({ - path: "/v21/customers:listAccessibleCustomers", - }); + const response = await this._makeRequest({ + method: "get", + path: "/v21/customers:listAccessibleCustomers", + });
231-231: Guard against callers passing a versioned sub-path.If a caller accidentally includes
vXX/inpath, you'll end up with.../v21/v21/.... Consider stripping any leading version segment.- path: `/${API_VERSION}/${path}:addOperations`, + path: `/${API_VERSION}/${String(path).replace(/^\/?v\d+\//, "")}:addOperations`, @@ - path: `/${API_VERSION}/${path}:run`, + path: `/${API_VERSION}/${String(path).replace(/^\/?v\d+\//, "")}:run`,Also applies to: 247-247
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs(2 hunks)components/google_ads/google_ads.app.mjs(9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- components/google_ads/actions/send-offline-conversion/send-offline-conversion.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
🔇 Additional comments (2)
components/google_ads/google_ads.app.mjs (2)
124-124: v21 path upgrades look correct and consistently use a leading “/”.Good alignment with the proxy and RPC-style endpoints. No functional concerns on these path updates.
Also applies to: 135-135, 154-154, 219-219, 231-231, 238-238, 247-247
37-37: Doc links updated to RPC v21 look good.Links resolve to the correct RPC resources; nice touch for DX.
Also applies to: 49-49, 74-74
GTFalcao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Resolves #18208
Summary by CodeRabbit
Documentation
Chores